package com.rz.javaSpringBoot.modules.spider.controller;

import com.rz.javaSpringBoot.modules.spider.entity.Coronavirus;
import com.rz.javaSpringBoot.modules.spider.service.CoronavirusService;
import org.springframework.beans.factory.annotation.Autowired;
import org.springframework.web.bind.annotation.GetMapping;
import org.springframework.web.bind.annotation.RequestMapping;
import org.springframework.web.bind.annotation.RestController;

import java.util.List;

/**
 *  CoronavirusController
 */
@RestController
@RequestMapping("/api")
public class CoronavirusController {

    @Autowired
    private CoronavirusService coronavirusService;

    /**
     * 127.0.0.1/api/coronaviruses ---- get
     */
    @GetMapping("/coronaviruses")
    public List<Coronavirus> getCoronaviruses() {
        return coronavirusService.getCoronaviruses();
    }
}
